package org.ruiyichen.guizhou.agr.bean.mode;

import org.ruiyichen.guizhou.agr.imp.IIrrigatedAreaFilter;

import java.io.Serializable;

public class IIrrigatedAreaModel implements IIrrigatedAreaFilter,Serializable {

    public boolean isEdit;

    public boolean hasDevice;


    public String irrigId;
    public String irrigBackupId;
    public String landId;
    public String irrigNumber;
    //eg 默认区域
    public String irrigName;
    /**
     * 设备数量
     */
    public int irrigDeviceTotal;

    public String irrigType;
    public String irrigState;
    public String irrigInterval;
    public String irrigIsirrigationweekend;
    public String irrigWorkdays;
    public String irrigSethours;
    public String irrigStart;
    public String irrigEnd;
    public String irrigTimelist;
    public String delFlag;
    public String status;

    public IIrrigatedAreaModel(boolean isEdit, String irrigName, boolean hasDevice) {
        this.isEdit = isEdit;
        this.irrigName = irrigName;
        this.hasDevice = hasDevice;
    }


    @Override
    public boolean getIIsDelete() {
        return isEdit;
    }

    @Override
    public String getIIrrigatedAreaDesc() {
        return irrigName + "(" + irrigDeviceTotal + "个设备)";
    }

    @Override
    public void setIIsEdit(boolean isEdit) {
        this.isEdit = isEdit;
    }

    @Override
    public boolean hasIDevice() {
        return !"0".equals(irrigId);
    }
}
